//
//  OrderSettlementCell.m
//  ios-supplier
//
//  Created by Benlai on 15/8/29.
//  Copyright (c) 2015年 feynmanyuan. All rights reserved.
//

#import "OrderSettlementCell.h"

@interface OrderSettlementCell ()
@property (weak, nonatomic) IBOutlet UILabel *settlementCycle;//结算周期
@property (weak, nonatomic) IBOutlet UILabel *orderStartTime;//总结算金额
@property (weak, nonatomic) IBOutlet UILabel *orderEndTime;//商品结算总金额
@property (weak, nonatomic) IBOutlet UILabel *orderTotalCount;//调单补贴总金额
@property (weak, nonatomic) IBOutlet UILabel *orderTotalAmount;//订单补贴总金额
@property (weak, nonatomic) IBOutlet UILabel *orderArrivePay;//订单扣款总金额
@property (weak, nonatomic) IBOutlet UILabel *orderOnlinePay;//商户补贴总金额
@property (weak, nonatomic) IBOutlet UILabel *orderTotalPay;//商户扣款总金额

@end
@implementation OrderSettlementCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setSettlement:(JFBSettlementDS *)settlement
{
    NSString *startTime = [[NSMutableString stringWithFormat:@"%@",settlement.start_at]substringToIndex:11];
    NSString *endTime = [[NSMutableString stringWithFormat:@"%@",settlement.end_at]substringToIndex:10];
    self.settlementCycle.text = [NSMutableString stringWithFormat:@"%@%@",startTime,endTime];
    double flo = [settlement.total_settle_price doubleValue];
    double flo1 = [settlement.shop_bonus doubleValue];
    double flo2 = [settlement.shop_fine doubleValue];
    double flo3 = flo+flo1-flo2;
    self.orderStartTime.text = [NSMutableString stringWithFormat:@"￥:%.1f",flo3];
    NSLog(@"%@",self.orderStartTime.text);
    self.orderEndTime.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.total_settle_price]];
    self.orderTotalCount.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.total_transfer_bonus]];
    self.orderTotalAmount.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.total_so_bonus]];
    self.orderArrivePay.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.total_so_fine]];
    self.orderOnlinePay.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.shop_bonus]];
    self.orderTotalPay.text = [NSString stringWithFormat:@"￥:%@",[NSString decimalToString:settlement.shop_fine]];
    
    
    
    
    
    
//    self.orderStartTime.text = [[NSMutableString stringWithString: settlement.start_at] substringToIndex: 10];
//    self.orderEndTime.text = [[NSMutableString stringWithString: settlement.end_at] substringToIndex: 10];
//    self.orderTotalCount.text = [NSString stringWithFormat: @"%ld", (long)settlement.so_count];
//    self.orderTotalAmount.text = [NSString stringWithFormat: @"￥%@", [NSString decimalToString: settlement.total_settle_price]];
//    self.orderArrivePay.text =  [NSString stringWithFormat: @"￥%@", [NSString decimalToString: settlement.total_balance_cod]];
//    self.orderOnlinePay.text = [NSString stringWithFormat: @"￥%@", [NSString decimalToString: settlement.total_balance_epay]];
//    self.orderTotalPay.text = [NSString stringWithFormat: @"￥%@", [NSString decimalToString: settlement.total_settle_price]];
}
@end
